home *** CD-ROM | disk | FTP | other *** search
/ Total Network Tools 2002 / NextStepPublishing-TotalNetworkTools2002-Win95.iso / Archive / Web Server / PHP.EXE / pear / PHPDoc / xmlexporter / PhpdocXMLWarningExporter.php < prev   
Encoding:
PHP Script  |  2001-02-18  |  1.5 KB  |  50 lines

  1. <?php
  2. /**
  3. * Exports a list of documentation warnings found by phpdoc
  4. */ 
  5. class PhpdocXMLWarningExporter extends PhpdocXMLExporter {
  6.     
  7.     /**
  8.     * Attributes of a warning container.
  9.     *
  10.     * @var  array
  11.     */
  12.     var $warningAttributes = array(
  13.                                     "name"          => "CDATA",
  14.                                     "type"          => "CDATA",
  15.                                     "elementtype"   => "CDATA"
  16.                                 );
  17.     
  18.     var $fileprefix = "warnings_";
  19.     
  20.     function PhpdocXMLWarningExporter() {
  21.         $this->PhpdocXMLExporter();
  22.     } // end constructor
  23.     
  24.     function create() {
  25.  
  26.         reset($this->result);
  27.         while (list($file, $warnings) = each($this->result)) {
  28.             
  29.             $this->xmlwriter->startElement("warnings", "", array("file" => array( "type" => "CDATA", "value" => $file)));
  30.             
  31.             reset($warnings);
  32.             while (list($type, $warning) = each($warnings)) {
  33.             
  34.                 reset($warning);
  35.                 while (list($k, $data) = each($warning)) {
  36.                     $data["elementtype"] = $type;
  37.                     $this->xmlwriter->addElement("warning", $data["msg"], $this->getAttributes($data, $this->warningAttributes));
  38.                 }
  39.                     
  40.             }
  41.             
  42.             $this->xmlwriter->endElement("warnings");
  43.             
  44.         }
  45.         
  46.     } // end function create
  47.     
  48. } // end class PhpdocXMLWarningExporter
  49. ?>